package com.Jiang.service;

import com.Jiang.dao.Order.OrderMapper;
import com.Jiang.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("OrderServiceImpl")
public class OrderServiceImpl implements OrderService{
    @Autowired
    OrderMapper orderMapper;

    public void setOrderMapper(OrderMapper orderMapper) {
        this.orderMapper = orderMapper;
    }
//1.增加购物车
    public int addOrder(Map map) {
        return orderMapper.addOrder(map);
    }
//2.删除购物车
    @Override
    public int deleteOrder(int orderId) {
        return orderMapper.deleteOrder(orderId);
    }
//3.查询购物车 用户
    @Override
    public List<Order> selectOrder(String userId) {
        return orderMapper.selectOrder(userId);
    }
//4.商家查询全部订单
    @Override
    public List<Order> selectAllOrder() {
        return orderMapper.selectAllOrder();
    }
//5.修改订单
    @Override
    public int updateOrder(int orderId) {
        return orderMapper.updateOrder(orderId);
    }

    @Override
    public List<Order> queryOrder(Map map) {
        return orderMapper.queryOrder(map);
    }

    @Override
    public List<Order> userQueryOrder(Map map) {
        return orderMapper.userQueryOrder(map);
    }
}
